<template>
	<view class="my-input-number" @click.stop="">
		<text class="icon_minus" @click="minus">-</text>
		<text class="inputText">{{ number }}</text>
		<text class="icon_plus" @click="plus">+</text>
	</view>
</template>

<script>
export default {
	name: 'MyInputNumber',
	props: {
		count: Number,
		idid: Number
	},
	computed: {
		number() {
			return this.count;
		}
	},
	data() {
		return {
			operator: ''
		};
	},
	methods: {
		minus() {
			this.$emit('changeNumberEvent', 'minus', this.idid);
			//this.operator = 'minus';
			//this.changeNumber();
		},
		plus() {
			this.$emit('changeNumberEvent', 'plus', this.idid);
			//this.operator = 'plus';
			//this.changeNumber();
		},
		// changeNumber() {
		// 	this.$emit('changeNumberEvent', this.operator);
		// }
	}
};
</script>

<style lang="scss">
	
	.icon_minus,
	.icon_plus {
		font-size: 28rpx;
		border: 1px solid #333;
		height: 36rpx;
		width: 36rpx;
		line-height: 36rpx;
		display: inline-block;
		text-align: center;
		border-radius: 24rpx;
		font-weight: bold;
	}
	
	.icon_minus {
		color: #333;
	}
	
	.icon_plus {
		color: #333;
	}
	
	.my-input-number {
		display: inline-block;
		user-select: none;
	
		.inputText {
			display: inline-block;
			width: 50rpx;
			font-size: 30rpx;
			text-align: center;
		}
	}
	
</style>
